package helper.base

object ToTypeHelper {
    abstract class ToTypeTuple<E, F> {
        protected abstract fun privateToF(
            e: E
        ): F

        val lhm: A2LHM<E, F> = A2LHM()

        fun toF(e: E): F {
            return if (lhm.containsKey(e)) {
                lhm[e]!!
            } else {
                val f = privateToF(e)
                lhm[e] = f
                f
            }
        }
    }
}